from selenium import webdriver
from time import sleep

br = webdriver.Chrome()
br.maximize_window()  # 最大化窗口


#网易云音乐签到
br.get("https://music.163.com/")  # 打开网址
br.switch_to.frame(0)  #转换frame
br.find_element_by_id('index-enter-default').click()  #点击登录

br.switch_to.default_content()# 切换回原页面内容
br.find_element_by_link_text("手机号登录").click()  #点击手机号登录
# 输入账号进行登录
br.find_element_by_xpath('//*[@id="p"]').send_keys("15161512201")
br.find_element_by_xpath('//*[@id="pw"]').send_keys("1126875067hty")
br.find_element_by_xpath("//div[@class='f-mgt20']/a").click()

qiandao = br.find_element_by_id("g_iframe")
br.switch_to.frame(qiandao)
br.find_element_by_link_text("签 到").click()  #点击签到
br.switch_to.default_content()# 切换回原页面内容

'''
#京东任务
br.get("https://passport.jd.com/new/login.aspx?ReturnUrl=https%3A%2F%2Fwww.jd.com%2F")  # 打开网址
br.find_element_by_class_name("QQ-icon").click()

qiandao = br.find_element_by_id("ptlogin_iframe")
br.switch_to.frame(qiandao)
br.find_element_by_id('img_out_1126875067').click()  #点击登录
br.switch_to.default_content()# 切换回原页面内容

br.get("https://vip.jd.com/")  # 打开网址
'''





